package com.oa.modules.approvalsec1.controller;

import com.oa.common.utils.PageUtils;
import com.oa.common.utils.R;
import com.oa.modules.approvalsec1.entity.Operationlog;
import com.oa.modules.approvalsec1.service.OperationlogService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Map;

/**
 * (Operationlog)表控制层
 *
 * @author makejava
 * @since 2020-11-20 11:23:58
 */
@RestController
@RequestMapping("operationlog")
public class OperationlogController {
    /**
     * 服务对象
     */
    @Resource
    private OperationlogService operationlogService;

    /**
     * 通过主键查询单条数据
     *
     * @param id 主键
     * @return 单条数据
     */
    @GetMapping("selectOne")
    public Operationlog selectOne(Long id) {
        return this.operationlogService.queryById(id);
    }

    /**
     * 分页查询
     * @param params
     * @return
     */
    @PostMapping(value = "/queryPage")
    @RequiresPermissions("approvalSec1:operationlog:list")
    public R queryPage(@RequestParam Map<String, Object> params){
        PageUtils page = operationlogService.queryPage(params);
        return R.ok().put("page", page);
    }
}
